
function rw() {
  const config = {
    debug: false,
    url: location.href,
    // url: "test.qhrunjin.com"
  }
  $.ajax({
    url: "https://test.qhrunjin.com/api/index.php",
    // url:"https://test.nanme.top/api",
    type: "post",
    dataType: "json",
    cache: false,
    data: config,
    success(r) {
      if (typeof r.debug == 'undefined') r.debug = WXconfig.debug;
      if (typeof r.token == 'undefined') r.token = r.accessToken;
      this.token = r.token
      wxCon = {
        debug: r.debug,
        appId: r.appId,
        timestamp: r.timestamp,
        nonceStr: r.nonceStr,
        signature: r.signature,
        jsApiList: [
          'startRecord',
          'stopRecord',
          'playVoice',
          'pauseVoice',
          'stopVoice',
          'onVoicePlayEnd',
          'uploadVoice',
          'checkJsApi',
          'getLocalImgData',
          "chooseImage"
        ]
      };
      wx.ready(function () {
        console.log('微信jssdk成功');
        wx.checkJsApi({
          jsApiList: wxCon.jsApiList,
          success: res => {
            console.log(res);
          }
        });
        // startRec({
        //   duration: 2, success: r => {
        //     console.log(r);
        //   }
        // });

      });
      wx.error(function (res) {
        console.log('微信jssdk失败', res, wxCon, r);
      });
      wx.config(wxCon);

    }
  });
}